#include "actionqueue.h"

void ActionQueue::action_push(ActionNode *node)
{
    if (node == NULL) {
        return;
    }
    actionlist.push_back(node);
    return;
}

ActionNode *ActionQueue::action_poll()
{
    ActionNode *node = actionlist.get_front();
    actionlist.pop_front();
    return node;
}

bool ActionQueue::empty()
{
    if (actionlist.empty()) {
        return true;
    }
    ActionNode *node = actionlist.get_front();
    if (node->timestamp > SDL_GetTicks()) {
        return true;
    } else {
        return false;
    }
}

ActionQueue::ActionQueue()
{
}

ActionQueue::~ActionQueue()
{
}
